package com.stony.mapper;

import com.stony.model.UserModel;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by ShiHui on 2014/6/6.
 */
public class UserMapper implements RowMapper<UserModel> {

    @Override
    public UserModel mapRow(ResultSet rs, int rowNum) throws SQLException {
        UserModel user = new UserModel(rs.getString("username"), rs.getString("password"));
        user.setId(rs.getInt("id"));
        return user;
    }
}
